import request from '@/utils/request'

const url = 'souvenir/category/'

export const addCategory = (data) => {
  return request({
    url: url + 'addCategory',
    method: 'post',
    data
  })
}

export const updateCategory = (data) => {
  return request({
    url: url + 'updateCategory',
    method: 'put',
    data
  })
}

export const deleteCategory = (categoryId) => {
  return request({
    url: url + 'deleteCategory' + '/' + categoryId,
    method: 'delete'
  })
}

export const getCategoryWithPage = (data) => {
  return request({
    url: url + 'getCategoryWithPage',
    method: 'post',
    data
  })
}

export const getCategoryById = (categoryId) => {
  return request({
    url: url + 'getCategoryById' + '/' + categoryId,
    method: 'get'
  })
}

export const getCategoryWithTree = () => {
  return request({
    url: url + 'getCategoryWithTree',
    method: 'post'
  })
}
